package view;

import javax.swing.JPanel;

import java.util.Observer;
import java.util.Observable;
import java.util.logging.Level;
import java.util.logging.Logger;

import utils.GoogleMapEditorPan;

public class GoogleMapContainer extends JPanel implements Observer{
	
	private static final long serialVersionUID = 1L;
	private GoogleMapEditorPan googleMap;
	
	public GoogleMapContainer(Observable obs){
		obs.addObserver(this);
		
		googleMap = new GoogleMapEditorPan();
	}
		
	@Override
	public void update(Observable obs, Object obj){
		String[] points = (String[])obj;
		
		try { 
			googleMap.setMap(points[0], points[1], points[2], 500, 400);
			add(googleMap);
			updateUI();

		}catch (Exception ex) {
	       Logger.getLogger(GoogleMapEditorPan.class.getName()).log(Level.SEVERE, null, ex);
	   }
	}
}
